package tbdp.tool.writer;

import java.util.Map;

import tbdp.tool.common.ColumnDesc;
import tbdp.tool.common.JobConstants;
import tbdp.tool.common.Record;
import tbdp.tool.config.WriterConfig;
import tbdp.tool.context.JobContext;
import tbdp.tool.spi.RecordIterator;
import tbdp.tool.spi.Writer;

/**
 * @author xbkaishui
 * @version $Id: HbaseWriter.java, v 0.1 2017-08-17 上午12:10 xbkaishui Exp $$
 */
public class HbaseWriter extends Writer {
    @Override
    public void write(JobContext context, RecordIterator recordIterator) {
        WriterConfig writerConfig = context.getJobConfig().getWriter();
        Map<String, Object> params = writerConfig.getConfig();
        while (recordIterator.hasNext()) {
            Record record = (Record) recordIterator.next();
            ColumnDesc[] columns = (ColumnDesc[]) context.getValue(JobConstants.COLUMN_SCHEMA);
        }
    }

    @Override
    public void close(JobContext context) {

    }

    @Override
    public String getType() {
        return "hbase";
    }
}
